#!/usr/bin/python2.4

# pylint: disable-msg=C6304

"""Tests the time converstion routines."""

import time
import unittest

from timeformat import FormatTime
from timeformat import ScanTimeString


class TestTimeFormat(unittest.TestCase):

  def testScan(self):
    self.assertEqual(1305154800, ScanTimeString('2011-05-11 1600'))
    self.assertEqual('Wed May 11 16:00:00 2011',
                     time.ctime(ScanTimeString('2011-05-11 1600')))
    self.assertEqual('2011-05-11 1600', FormatTime(1305154800))


def main():
  unittest.main()


if __name__ == '__main__':
  main()
